<template>
  <div class="app-container check-right">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item v-if="!parentProjectNo" label="项目" prop="projectNo">
        <el-select v-model="queryParams.projectNo" @change="getFunList" placeholder="请选择项目" clearable>
          <el-option
            v-for="p in projectList"
            :key="p.projectNo"
            :label="p.projectName"
            :value="p.projectNo"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="功能"  v-if="!parentProjectFunNo" prop="projectFunNo">
        <treeselect style="width:200px;" v-model="queryParams.projectFunNo" :options="funList"  :show-count="true" placeholder="请选择功能" />
      </el-form-item>
      <el-form-item label="测试点状态" :label-position="'left'" label-width="auto" prop="finalStatus">
        <el-select v-model="queryParams.finalStatus" placeholder="请选择测试点状态" clearable>
          <el-option
            v-for="dict in dict.type.final_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="测试点类型" :label-position="'left'" label-width="auto" prop="projectFunPointType">
        <el-select v-model="queryParams.projectFunPointType" placeholder="请选择测试点类型" clearable>
          <el-option
            v-for="dict in dict.type.test_point_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="用例状态" prop="hasCase">
        <el-select v-model="queryParams.caseFinalStatus" placeholder="请选择用例状态" clearable>
          <el-option
            v-for="dict in dict.type.final_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="用例数据状态" label-width="auto" prop="hasCase">
        <el-select v-model="queryParams.hasCase" placeholder="请选择用例数据状态" clearable>
          <el-option
            :label="'未生成'"
            :value="'0'"
          />
          <el-option
            :label="'已生成'"
            :value="'1'"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="开始时间" prop="startDate">
        <el-date-picker clearable
          v-model="queryParams.startDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建开始时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="结束时间" prop="endDate">
        <el-date-picker clearable
          v-model="queryParams.endDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建开始时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>

        <el-button
          type="primary"
          plain

          :icon="batchCreateBtnStatus.icon"
          size="mini"
          v-hasPermi="['smart:case:ai_create']"
          @click="handleBatchAiCreateTestCase"
        >生成用例</el-button>

        <el-button
          type="primary"
          plain
          :disabled="batchOptimizeBtnStatus.disabled"
          :icon="batchOptimizeBtnStatus.icon"
          size="mini"
          v-hasPermi="['smart:case:ai_create']"
          @click="handleBatchAiOptimizeTestCase"
        >优化用例</el-button>


        <el-button
          type="primary"
          plain
          v-if="queryParams.hasCase == '1'"
          :icon="batchCheckBtnStatus.icon"
          size="mini"
          v-hasPermi="['smart:case:all_check']"
          @click="handleBatchCheck"
        >一键评审</el-button>


      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          v-hasPermi="['smart:case:add']"
          @click="handleAdd"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          v-hasPermi="['smart:case:remove']"
          @click="handleDelete"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          plain
          icon="el-icon-upload2"
          size="mini"
          v-hasPermi="['smart:case:import']"
          v-if="queryParams.projectNo && queryParams.projectFunNo"
          @click="handleImport"
        >导入</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-tooltip class="item" effect="dark" content="根据上面查询条件导出符合条件的用例" placement="right-start">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          v-hasPermi="['smart:case:export']"
          @click="handleExport"
        >导出</el-button>
        </el-tooltip>
      </el-col>
      <el-col :span="1.5">
        <el-tooltip class="item" effect="dark" content="导入的测试点数据需要关联需求" placement="right-start">
        <el-button
          type="info"
          plain
          icon="el-icon-sort"
          size="mini"
          v-hasPermi="['smart:case:relation']"
          :disabled="relationDocDisabled"
          @click="relationDoc"
        >关联需求</el-button>
        </el-tooltip>
      </el-col>

      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-row :gutter="10" class="mb8" v-if="batchCreateCaseRecord < 100">
      <el-progress :text-inside="true" :stroke-width="18" :text-color="'#ffffff'" :percentage="batchCreateCaseRecord" :format="format"></el-progress>
    </el-row>

    <el-table v-loading="loading" :data="pointList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column type="expand">
      <template slot-scope="scope">
        <el-form label-position="left" inline class="demo-table-expand">
          <el-form-item label="项目">
            <span>{{ scope.row.projectName }}</span>
          </el-form-item>
          <el-form-item label="功能">
            <span>{{ scope.row.funName }}</span>
          </el-form-item>
          <el-form-item label="功能路径">
            <span>{{ scope.row.projectFunPointPath }}</span>
          </el-form-item>
          <el-form-item label="用例标题" :show-overflow-tooltip="true">
            <span>{{ scope.row.caseVO.caseTitle }}</span>
          </el-form-item>
          <el-form-item label="测试点类型">
             <span>{{ scope.row.projectFunPointTypeName }}</span>
          </el-form-item>
          <el-form-item label="测试点描述">
             <span>{{ scope.row.projectFunPointDesc }}</span>
          </el-form-item>
          <el-form-item label="用例类型">
              <template  v-if="scope.row.caseVO">
                <dict-tag :options="dict.type.case_type" :value="scope.row.caseVO.caseType"/>
              </template>
          </el-form-item>
          <el-form-item label="用例难度" >
             <template  v-if="scope.row.caseVO">
              <dict-tag :options="dict.type.case_diff_level" :value="scope.row.caseVO.caseDiffLevel"/>
             </template>
          </el-form-item>
          <el-form-item label="用例优先级">
              <template  v-if="scope.row.caseVO">
                <dict-tag :options="dict.type.case_priority" :value="scope.row.caseVO.casePriority"/>
              </template>
          </el-form-item>
          <el-form-item label="前置操作">
            <template  v-if="scope.row.caseVO">
              <span v-html="scope.row.caseVO.beforeStepDesc"></span>
            </template>
          </el-form-item>
          <el-form-item label="操作步骤">
            <template  v-if="scope.row.caseVO">
              <span v-html="scope.row.caseVO.stepDesc"></span>
            </template>
          </el-form-item>
          <el-form-item label="预期结果">
            <template  v-if="scope.row.caseVO">
              <span v-html="scope.row.caseVO.acceptResultDesc"></span>
            </template>
          </el-form-item>
        </el-form>
      </template>
      </el-table-column>
      <el-table-column label="测试点类型" align="center" prop="projectFunPointType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.test_point_type" :value="scope.row.projectFunPointType"/>
        </template>
      </el-table-column>
      <el-table-column label="测试点路径" :show-overflow-tooltip="true" align="center" prop="projectFunPointPath" />
      <el-table-column label="测试点描述" :show-overflow-tooltip="true" align="center" prop="projectFunPointDesc" />
      <el-table-column label="用例标题" :show-overflow-tooltip="true" align="center" prop="caseVO.caseTitle" />
      <el-table-column label="用例类型" align="center" prop="caseVO.caseType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.case_type" :value="scope.row.caseVO.caseType"/>
        </template>
      </el-table-column>
      <el-table-column label="难度" align="center" prop="caseVO.caseDiffLevel">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.case_diff_level" :value="scope.row.caseVO.caseDiffLevel"/>
        </template>
      </el-table-column>
      <el-table-column label="优先级" align="center" prop="caseVO.casePriority">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.case_priority" :value="scope.row.caseVO.casePriority"/>
        </template>
      </el-table-column>
      <el-table-column label="测试点状态" align="center" prop="status">
          <template slot-scope="scope">
            <el-tag :type="statusMap[scope.row.finalStatus].class">
              {{statusMap[scope.row.finalStatus].label}}
            </el-tag>
          </template>
      </el-table-column>
      <el-table-column label="用例状态" align="center" prop="status">
          <template  slot-scope="scope">
            <el-tag v-if="scope.row.caseVO.caseNo" :type="statusMap[scope.row.caseVO.finalStatus].class">
              {{statusMap[scope.row.caseVO.finalStatus].label}}
            </el-tag>
            <span v-if="!scope.row.caseVO.caseNo">-</span>
          </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button v-if="scope.row.isDeleted==0"
            size="mini"
            type="text"
            icon="el-icon-edit"
            v-hasPermi="['smart:case:edit']"
            @click="handleUpdate(scope.row)"
          >修改</el-button>
          <el-button v-if="scope.row.caseVO.caseNo"
            size="mini"
            type="text"
            icon="el-icon-edit"
            v-hasPermi="['smart:case:check']"
            @click="goCheck(scope.row.projectFunPointNo)"
          >评审</el-button>

          <el-dropdown size="mini" >
            <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
            <el-dropdown-menu slot="dropdown">

              <el-dropdown-item
                                v-if="scope.row.status==0"
                                :icon="scope.row.icon"
                                @click.native="handleSignalAiCreateTestCase(scope.row)"
                                v-hasPermi="['smart:case:ai_create']"
                                :disabled="scope.row.isDisabled"
              >生成用例</el-dropdown-item>

              <el-dropdown-item
                                v-if="scope.row.status==2 || scope.row.status==3"
                                :icon="scope.row.icon"
                                @click.native="handleSignalAiCreateTestCase(scope.row)"
                                v-hasPermi="['smart:case:ai_create']"
                                :disabled="scope.row.isDisabled"
              >重新生成用例</el-dropdown-item>

              <el-dropdown-item
                                v-if="scope.row.isDeleted==0"
                                icon="el-icon-delete"
                                @click.native="handleDelete(scope.row)"
                                v-hasPermi="['smart:case:remove']"
                                :disabled="scope.row.isDisabled"
              >删除</el-dropdown-item>


              <el-dropdown-item
                icon="el-icon-time"
                @click.native="handleHistory(scope.row)"
              >测试点修订历史记录</el-dropdown-item>

              <el-dropdown-item
                icon="el-icon-time"
                @click.native="handleCaseHistory(scope.row)"
              >用例修订历史记录</el-dropdown-item>


<!--              <el-button v-if="scope.row.status==0"-->
<!--                size="mini"-->
<!--                type="text"-->
<!--                :disabled="scope.row.isDisabled"-->
<!--                :icon="scope.row.icon"-->
<!--                @click="handleSignalAiCreateTestCase(scope.row)"-->
<!--                v-hasPermi="['smart:case:ai_create']"-->
<!--              >生成用例</el-button><br/>-->

<!--              <el-button v-if="scope.row.status==2 || scope.row.status==3"-->
<!--                size="mini"-->
<!--                type="text"-->
<!--                :disabled="scope.row.isDisabled"-->
<!--                :icon="scope.row.icon"-->
<!--                @click="handleSignalAiCreateTestCase(scope.row)"-->
<!--                v-hasPermi="['smart:case:ai_create']"-->
<!--              >重新生成用例</el-button><br/>-->

<!--              <el-button v-if="scope.row.isDeleted==0"-->
<!--                size="mini"-->
<!--                type="text"-->
<!--                icon="el-icon-delete"-->
<!--                @click="handleDelete(scope.row)"-->
<!--                v-hasPermi="['smart:case:remove']"-->
<!--              >删除</el-button><br/>-->

<!--              <el-button-->
<!--                size="mini"-->
<!--                type="text"-->
<!--                icon="el-icon-time"-->
<!--                @click="handleHistory(scope.row)"-->
<!--              >测试点修订历史记录</el-button><br/>-->
<!--              <el-button-->
<!--                size="mini"-->
<!--                type="text"-->
<!--                icon="el-icon-time"-->
<!--                @click="handleCaseHistory(scope.row)"-->
<!--              >用例修订历史记录</el-button><br/>-->


            </el-dropdown-menu>
          </el-dropdown>


          <span v-if="scope.row.isDeleted==1">-</span>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 查看测试点历史记录 -->
    <el-dialog :title="historyData.title" :visible.sync="historyData.open" width="850px" append-to-body>
      <div class="block">
        <el-table
            :data="historyData.data"
            style="width: 100%">
            <el-table-column
              type="index"
              label="序号"
              width="50">
            </el-table-column>
            <el-table-column
              prop="projectFunPointTypeLabel"
              label="测试点类型"
              width="100">
            </el-table-column>

            <el-table-column
              prop="projectFunPointPath"
              label="测试点路径"
              >
            </el-table-column>

            <el-table-column
              prop="projectFunPointDesc"
              label="测试点描述">
            </el-table-column>
          </el-table>
      </div>
    </el-dialog>

    <!-- 查看用例历史记录 -->
    <el-dialog :title="caseHistoryData.title" :visible.sync="caseHistoryData.open" width="1150px" append-to-body>
      <div class="block">
        <el-table
            :data="caseHistoryData.data"
            style="width: 100%">
            <el-table-column
              type="index"
              label="序号"
              width="50">
            </el-table-column>
            <el-table-column
              prop="caseTitle"
              label="标题"
              width="180">
            </el-table-column>
            <el-table-column
              prop="testPointTypeName"
              label="类型"
              width="80">
            </el-table-column>
            <el-table-column
              prop="caseTypeName"
              label="用例类型">
            </el-table-column>

            <el-table-column
              prop="caseDiffLevelName"
              width="80"
              label="难度">
            </el-table-column>

            <el-table-column
              prop="casePriorityName"
              width="80"
              label="优先级">
            </el-table-column>
            <el-table-column
              prop="beforeStep"
              label="前置操作">
            </el-table-column>
            <el-table-column
              prop="step"
              label="操作步骤">
            </el-table-column>
             <el-table-column
              prop="accessResult"
              label="预期结果">
            </el-table-column>
            <el-table-column
              label="状态">
              <template slot-scope="scope">
                <el-tag :type="caseHistoryStatusMap[scope.row.isCurrent].class">
                  {{caseHistoryStatusMap[scope.row.isCurrent].label}}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column
              label="数据状态">
              <template slot-scope="scope">
                <el-tag  :type="statusMap[scope.row.finalStatus].class">
                  {{statusMap[scope.row.finalStatus].label}}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column
              prop="updateDate"
              :formatter="caseHistoryDateFormat"
              label="更新时间">
            </el-table-column>
            <el-table-column
              label="操作">
               <template slot-scope="scope">
                  <el-button v-if="scope.row.isCurrent==2" @click="setCurrentCase(scope.row)"
                    type="text"
                    size="small">
                    设为当前
                  </el-button>
                  <span v-if="scope.row.isCurrent!=2">-</span>
              </template>
            </el-table-column>
          </el-table>
      </div>
    </el-dialog>
    <!-- 添加或修改项目功能测试点对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="项目" prop="projectNo">
          <el-select v-model="form.projectNo" @change="check_change" placeholder="请选择项目">
            <el-option
              v-for="projectInfo in form.infoList"
              :key="projectInfo.projectNo"
              :label="projectInfo.projectName"
              :value="projectInfo.projectNo"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="功能" prop="projectFunNo">
          <treeselect @select="getFunInfoDetailBack" v-model="form.projectFunNo" :options="form.funList" :show-count="true" placeholder="请选择功能" />
        </el-form-item>
        <el-form-item label="类型" prop="projectFunPointType">
          <el-select v-model="form.projectFunPointType" :value="form.projectFunPointType" @change="changePage" placeholder="请选择测试点类型">
            <el-option
              v-for="(dict,index) in dict.type.test_point_type"
              :key="index"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="页面" v-if="form.projectFunPointType!='PROCESS'">
          <el-select placeholder="请选择页面" v-model="form.pageNo" @change="changePage" >
            <el-option
              v-for="(page,index) in editPointFunInfo[form.projectFunNo]"
              :key="index"
              :label="page.pageName"
              :value="page.pageNo"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="输入项" v-if="form.projectFunPointType=='PAGE_INPUT'">
          <el-select v-model="form.typeId" placeholder="请选择输入项">
            <el-option
              v-for="inputOption in inputList"
              :key="inputOption.id"
              :label="inputOption.optionName"
              :value="inputOption.id"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="输出项" v-if="form.projectFunPointType=='PAGE_OUTPUT'">
          <el-select v-model="form.typeId" placeholder="请选择输出项">
            <el-option
              v-for="outOption in outList"
              :key="outOption.id"
              :label="outOption.optionName"
              :value="outOption.id"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="业务规则" v-if="form.projectFunPointType=='FUN'">
          <el-select v-model="form.typeId" placeholder="请选择业务规则">
            <el-option
              v-for="ruleObj in ruleList"
              :key="ruleObj.id"
              :label="ruleObj.desc"
              :value="ruleObj.id"
            >
            <div :title="ruleObj.desc" style="width:200px;overflow:hidden ">{{ ruleObj.desc }}</div>
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="描述" prop="projectFunPointDesc">
          <el-input v-model="form.projectFunPointDesc" type="textarea" placeholder="请输入内容" />
        </el-form-item>

      </el-form>
      <hr/>
      <el-link type="primary" v-if="!addCaseForm.show" :underline="false" @click="addCase">添加用例</el-link>
      <el-link type="primary" v-if="addCaseForm.show" :underline="false" @click="closeAddCase">收起</el-link>
      <el-form v-if="addCaseForm.show" ref="addCaseForm.form" :model="addCaseForm.form" :rules="addCaseFormRules" label-width="80px">
        <el-form-item label="" prop="caseTitle">
          <el-link type="primary" @click="ai_create_case" :icon="createAiCaseDemoIcon" :disabled="createAiCaseDemoDisable" :underline="false" style="float:right;" >生成用例</el-link>
        </el-form-item>
        <el-form-item label="标题" prop="caseTitle">
          <el-input v-model="addCaseForm.form.caseTitle" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="类型" prop="caseType">
          <el-select v-model="addCaseForm.form.caseType" placeholder="请选择用例类型">
            <el-option
              v-for="dict in dict.type.case_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="难度" prop="caseDiffLevel">
          <el-select v-model="addCaseForm.form.caseDiffLevel" placeholder="请选择用例难度">
            <el-option
              v-for="dict in dict.type.case_diff_level"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="优先级" prop="casePriority">
          <el-select v-model="addCaseForm.form.casePriority" placeholder="请选择用例优先级">
            <el-option
              v-for="dict in dict.type.case_priority"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="前置操作" prop="beforeStepDesc">
          <el-input v-model="addCaseForm.form.beforeStepDesc" type="textarea" :placeholder="templateInfo" />
        </el-form-item>
        <el-form-item label="操作步骤" prop="stepDesc">
          <el-input v-model="addCaseForm.form.stepDesc" type="textarea" :placeholder="templateInfo" />
        </el-form-item>
        <el-form-item label="预期结果" prop="acceptResultDesc">
          <el-input v-model="addCaseForm.form.acceptResultDesc" type="textarea" :placeholder="templateInfo" />
        </el-form-item>
      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
        <el-button v-if="form.finalStatus != 3 && form.projectFunPointNo != null && form.projectFunPointNo != ''" type="primary" @click="submitChecked">测试点审核通过</el-button>
        <el-button v-if="form.finalStatus == 3 && addCaseForm.form.finalStatus != 3 && addCaseForm.form.caseNo != null && addCaseForm.form.caseNo != ''" type="primary" @click="submitCaseChecked">用例审核通过</el-button>
      </div>
    </el-dialog>


    <!-- 测试点用例关联需求 -->
    <!-- 添加或修改项目功能测试点对话框 -->
    <el-dialog :title="'关联需求'" :visible.sync="relationObj.open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="项目" prop="projectNo">
          <el-select :disabled="true" v-model="form.projectNo" @change="check_change" placeholder="请选择项目">
            <el-option
              v-for="projectInfo in form.infoList"
              :key="projectInfo.projectNo"
              :label="projectInfo.projectName"
              :value="projectInfo.projectNo"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="功能" prop="projectFunNo">
          <treeselect :disabled="true" @select="getFunInfoDetailBack" v-model="form.projectFunNo" :options="form.funList" :show-count="true" placeholder="请选择功能" />
        </el-form-item>
        <el-form-item label="类型" prop="projectFunPointType">
          <el-select :disabled="true" v-model="form.projectFunPointType" :value="form.projectFunPointType" @change="changePage" placeholder="请选择测试点类型">
            <el-option
              v-for="(dict,index) in dict.type.test_point_type"
              :key="index"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="页面" v-if="form.projectFunPointType!='PROCESS'">
          <el-select placeholder="请选择页面" v-model="form.pageNo" @change="changePage" >
            <el-option
              v-for="(page,index) in editPointFunInfo[form.projectFunNo]"
              :key="index"
              :label="page.pageName"
              :value="page.pageNo"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="输入项" v-if="form.projectFunPointType=='PAGE_INPUT'">
          <el-select v-model="form.typeId" placeholder="请选择输入项">
            <el-option
              v-for="inputOption in inputList"
              :key="inputOption.id"
              :label="inputOption.optionName"
              :value="inputOption.id"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="输出项" v-if="form.projectFunPointType=='PAGE_OUTPUT'">
          <el-select v-model="form.typeId" placeholder="请选择输出项">
            <el-option
              v-for="outOption in outList"
              :key="outOption.id"
              :label="outOption.optionName"
              :value="outOption.id"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="业务规则" v-if="form.projectFunPointType=='FUN'">
          <el-select v-model="form.typeId" placeholder="请选择业务规则">
            <el-option
              v-for="ruleObj in ruleList"
              :key="ruleObj.id"
              :label="ruleObj.desc"
              :value="ruleObj.id"
            >
            <div :title="ruleObj.desc" style="width:200px;overflow:hidden ">{{ ruleObj.desc }}</div>
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitRelationForm">确 定</el-button>
        <el-button @click="cancelRelation">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 导入对话框 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        :data="queryParams"
        drag
      >
        <input type="hidden" name="projectNo" v-model="queryParams.projectNo" />
        <input type="hidden" name="projectFunNo" v-model="queryParams.projectFunNo" />
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>


  </div>
</template>

<script>
import { get_fun_info_detail, listPoint, getPoint, delPoint, addPoint, updatePoint,updatePoint_, aiCreateSignalCase, aiCreateBatchCase, getBatchTaskRecord,getProjectList, listFun,point_checked_pass, point_history, aiCreateCase, batchCheck, optimizeTestCase } from "@/api/ai_smart/point";
import { getCase, case_history, case_checked_pass, set_current_case } from "@/api/ai_smart/case";
import Treeselect from "@riophae/vue-treeselect";
import { getToken } from "@/utils/auth";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
  props: ["parentProjectNo", "parentProjectFunNo"],
  name: "Point",
  dicts: ['is_deleted', 'test_point_type', 'case_type', 'case_diff_level', 'case_priority', 'final_status'],
  components: { Treeselect },
  data() {
    return {
      batchOptimizeBtnStatus:{
        icon: "",
        disabled: false
      },
      relationObj:{
        open: false,
        tempPointNo: null,

      },
      relationDocDisabled : true,
      currentPageNo: null,
      inputList: [],
      outList: [],
      ruleList: [],
      // 生成用例按钮图标
      createAiCaseDemoIcon: "el-icon-video-play",
      createAiCaseDemoDisable: false,
      // 项目导入参数
      upload: {
        // 是否显示弹出层（项目导入）
        open: false,
        // 弹出层标题（项目导入）
        title: "",
        // 是否禁用上传
        isUploading: false,
        // 设置上传的请求头部
        headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/ai_smart/point/importData"
      },

      // 用例历史记录
      caseHistoryData:{
        title: "用例历史记录",
        open: false,
        data: [],
      },

      // 查看测试点历史记录
      historyData:{
        title: "测试点历史记录",
        open: false,
        data: [],
      },


      // 用例文本域提示信息
       templateInfo: `1,xxxxxxxxx
2,xxxxxxxxx
3,xxxxxxxxx
…………`,

      // 添加用例的表单数据
      addCaseForm: {
        show: false,
        form: {}
      },
      type: null,
      typeId: null,

      funList: [],
      projectList: [],
      set_inter_val: null,
      batchCreateCaseRecord: 100,

      // 一键生成
      batchCreateBtnStatus:{
        "display": false,
        "icon": "el-icon-video-play"
      },

      // 一键评审
      batchCheckBtnStatus:{
        "display": false,
        "icon": "el-icon-thumb"
      },
      caseHistoryStatusMap:[
        {
          "class": "info",
          "label": "-"
        },
        {
          "class": "success",
          "label": "当前"
        },
        {
          "class": "info",
          "label": "历史"
        },
      ],
      statusMap: [
        {
          "class": "info",
          "label": "AI生成"
        },
        {
          "class": "info",
          "label": "用户新增"
        },
        {
          "class": "primary",
          "label": "用户修改"
        },
        {
          "class": "success",
          "label": "已评审"
        }
      ],
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 项目功能测试点表格数据
      pointList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        projectNo: null,
        projectFunNo: null,
        projectFunPointNo: null,
        projectFunPointType: null,
        projectFunPointPath: null,
        createDate: null,
        startDate: null,
        endDate: null,
        createId: null,
        isDeleted: null,
        finalStatus: null,
        caseFinalStatus:null,
        fromFunDetail: 0,
        type: "",
        typeId: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        projectFunPointType: [
          { required: true, message: "测试点类型不能为空", trigger: "change" }
        ]
      },
      addCaseFormRules: {
        caseTitle: [
          { required: true, message: "用例名称不能为空", trigger: "blur" }
        ],
        caseType: [
          { required: true, message: "用例类型不能为空", trigger: "change" }
        ],
        caseDiffLevel: [
          { required: true, message: "用例难度不能为空", trigger: "change" }
        ],
        casePriority: [
          { required: true, message: "用例优先级不能为空", trigger: "change" }
        ]
      },
      editPointFunInfo: {}
    };
  },
  watch:{
    parentProjectFunNo(val, oldval){
      this.queryParams.projectFunNo = this.parentProjectFunNo;
      this.queryParams.projectNo = this.parentProjectNo;
      // this.queryParams.fromFunDetail = this.fromFunDetail;
      this.getList();
    },
    parentProjectNo(val, oldval){
      this.queryParams.projectFunNo = this.parentProjectFunNo;
      this.queryParams.projectNo = this.parentProjectNo;
      // this.queryParams.fromFunDetail = this.fromFunDetail;
      this.getList();
    },
    // fromFunDetail(val, oldval){
    //   this.queryParams.projectFunNo = this.parentProjectFunNo;
    //   this.queryParams.projectNo = this.parentProjectNo;
    //   this.queryParams.fromFunDetail = this.fromFunDetail;
    //   this.getList();
    // }
  },
  created() {


    this.queryParams.projectNo = this.$route.query && this.$route.query.projectNo;
    this.queryParams.projectFunNo = this.$route.query && this.$route.query.projectFunNo;
    if(this.$route.query && this.$route.query.fromFunDetail){
      this.queryParams.fromFunDetail = this.$route.query && this.$route.query.fromFunDetail;
      this.queryParams.type = this.$route.query && this.$route.query.type;
      this.queryParams.typeId = this.$route.query && this.$route.query.typeId;
    }

    if(this.parentProjectNo){
      this.queryParams.projectNo = this.parentProjectNo;
      if(this.parentProjectFunNo){
        this.queryParams.projectFunNo = this.parentProjectFunNo;
      }
    }else{
      this.getProjectListInfo();
      if(this.queryParams.projectFunNo){
        this.getFunList();
      }
    }
    this.getList();
  },
  activated(){

    this.queryParams.projectNo = this.$route.query && this.$route.query.projectNo;
    this.queryParams.projectFunNo = this.$route.query && this.$route.query.projectFunNo;

    if(this.$route.query && this.$route.query.fromFunDetail){
      this.queryParams.fromFunDetail = this.$route.query && this.$route.query.fromFunDetail;
      this.queryParams.type = this.$route.query && this.$route.query.type;
      this.queryParams.typeId = this.$route.query && this.$route.query.typeId;
    }


    if(this.parentProjectNo){
      this.queryParams.projectNo = this.parentProjectNo;
      if(this.parentProjectFunNo){
        this.queryParams.projectFunNo = this.parentProjectFunNo;
      }
    }else{
      this.getProjectListInfo();
      if(this.queryParams.projectFunNo){
        this.getFunList();
      }
    }

    this.getList();
  },
  methods: {
    // 格式化用例历史记录中的更新时间
    caseHistoryDateFormat(row, column, cellValue, index){
      if(cellValue){

       const updateDate =  new Date(cellValue);
       let year = updateDate.getFullYear();
       let month = updateDate.getMonth() + 1;
       if(month<10){
        month = "0"+month;
       }
       let day = updateDate.getDate();
       if(day<10){
        day = "0"+day;
       }
       let hours = updateDate.getHours();
       if(hours<10){
        hours = "0"+hours;
       }
       let min = updateDate.getMinutes();
       if(min<10){
        min = "0"+min;
       }
       let sec = updateDate.getSeconds();
       if(sec<10){
        sec = "0"+sec;
       }
       return year+"-"+month+"-"+day+" "+hours+":"+min+":"+sec;
      }
    },

    //设置为当前用例
    setCurrentCase(row){
      const data = {
        id: row.id,
        caseNo: row.caseNo,
        projectNo: row.projectNo,
        projectFunNo: row.projectFunNo,
        projectFunPointNo: row.projectFunPointNo
      };
      set_current_case(data).then(res=>{
        this.$modal.msgSuccess(res.msg);
        this.addCaseForm.show = false;
      });
    },

     // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();
    },
    // 下载模板操作
    importTemplate() {
      this.download('ai_smart/point/importTemplate', {
      }, `project_template_${new Date().getTime()}.xlsx`)
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
      this.getList();
    },

    // 导入按钮操作
    handleImport() {
      this.upload.title = "导入";
      this.upload.open = true;
    },

    // 查看用例历史记录
    handleCaseHistory(row){
      this.caseHistoryData.open = true;
      case_history(row.projectFunPointNo).then(res=>{
        this.caseHistoryData.data = res.data;
      });
    },

    // 点击添加用例按钮
    addCase(){
      this.addCaseForm.show = true;
    },

    // 点击收起按钮事件
    closeAddCase(){
      this.addCaseForm.show = false;
    },

    // 查看历史记录
    handleHistory(row){
      this.historyData.open = true;
      point_history(row.projectFunPointNo).then(res=>{
        this.historyData.data = res.data;
      });
    },

    /** 查询项目功能测试点列表 */
    getList() {
      this.loading = true;
      listPoint(this.queryParams).then(response => {
        this.pointList = response.rows;
        this.total = response.total;
        this.loading = false;
      });


    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    cancelRelation(){
      this.relationObj.open = false;
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        projectNo: null,
        projectFunNo: null,
        projectFunPointNo: null,
        projectFunPointType: null,
        projectFunPointPath: null,
        projectFunPointDesc: null,
        createDate: null,
        updateDate: null,
        createId: null,
        updateId: null,
        isDeleted: null
      };
      this.resetForm("form");
      this.addCaseForm.form = {};
      this.addCaseForm.show = false;
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.projectFunPointNo)
      this.single = selection.length!==1
      this.multiple = !selection.length
      let firstLabel = "";
      if(selection.length ==0){
        this.relationDocDisabled = true;
        this.relationObj.tempPointNo = null;
      }else{
        firstLabel = selection[0].projectFunPointType;
        this.relationDocDisabled = false;
        this.relationObj.tempPointNo = selection[0].projectFunPointNo;
        for(let i = 1; i < selection.length; i++){
          if(firstLabel != selection[i].projectFunPointType){
              this.relationDocDisabled = true;
          }
        }
      }


    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();


      getPoint("-1").then(response => {
        this.form = response.data;
        this.form.funList = [];
        this.open = true;
        this.title = "添加项目功能测试点";
      });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.projectFunPointNo || this.ids
      getPoint(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改项目功能测试点";
        this.check_change(this.form.projectNo);
        this.getFunInfoDetail();
      });
      if(!row.caseVO.caseNo){
          this.addCaseForm.form = {};
      }else{
          getCase(row.caseVO.caseNo).then(response => {
            this.addCaseForm.form = response.data;
            this.addCaseForm.show = true;
          });
      }

    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.addCaseForm.show){
            this.$refs["addCaseForm.form"].validate(valid1 =>{
                if(valid1){
                    if (this.form.projectFunPointNo != null) {
                        this.form.caseIo = this.addCaseForm.form;
                        updatePoint(this.form).then(response => {
                          this.$modal.msgSuccess("修改成功");
                          this.open = false;
                          this.getList();
                        });
                      } else {
                        this.form.caseIo = this.addCaseForm.form;
                        addPoint(this.form).then(response => {
                          this.$modal.msgSuccess("新增成功");
                          this.open = false;
                          this.getList();
                        });
                    }
                }


            });
          }else{
            if (this.form.projectFunPointNo != null) {
              updatePoint(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              });
            } else {
              addPoint(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              });
            }
          }


        }
      });
    },

    submitRelationForm(){

        this.form.ids = this.ids;

        console.log("===============");
        console.log(this.form);
        updatePoint_(this.form).then(response => {
          this.$modal.msgSuccess("关联成功");
          this.relationObj.open = false;
        })
    },
    // 用例审核通过
    submitCaseChecked(){
      case_checked_pass(this.addCaseForm.form.caseNo).then(res=>{
        this.$modal.msgSuccess(res.msg);
        this.open = false;
        this.getList();
      });
    },
    // 测试点审核通过
    submitChecked(){
      point_checked_pass(this.form.projectFunPointNo).then(res=>{
        this.$modal.msgSuccess(res.msg);
        this.open = false;
        this.getList();
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.projectFunPointNo || this.ids;
      this.$modal.confirm('是否确认删除？').then(function() {
        return delPoint(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('ai_smart/point/export', {
        ...this.queryParams
      }, `point_${new Date().getTime()}.xlsx`)
    },

    check_change(data){
      this.form.funList = [];
      for(let i = 0; i < this.form.infoList.length; i++){
        if(this.form.infoList[i].projectNo == data){
          this.form.funList = this.form.infoList[i].projectFunList;
          break;
        }
      }
    },

    // 一键评审
    handleBatchCheck(){
        this.batchCheckBtnStatus.display = true;
        this.batchCheckBtnStatus.icon = 'el-icon-loading';
        batchCheck(this.queryParams).then(res => {
          this.$modal.msgSuccess(res.msg);
          this.batchCheckBtnStatus.display = false;
          this.batchCheckBtnStatus.icon = 'el-icon-thumb';
        }).catch(()=>{
          this.batchCheckBtnStatus.display = false;
          this.batchCheckBtnStatus.icon = 'el-icon-thumb';
        });
    },

    // 用例优化
    handleBatchAiOptimizeTestCase(){
      console.log(!this.ids);
      console.log(this.ids);
      if(!this.ids | this.ids.length == 0){
        this.$modal.msgSuccess("请选择需要优化的用例");
        return ;
      }
      const data = {
        projectFunPointNos: this.ids
      }
      console.log(data);
      this.batchOptimizeBtnStatus.icon = 'el-icon-loading';
      this.batchOptimizeBtnStatus.display = true;
      optimizeTestCase(data).then((res)=>{
        this.$modal.msgSuccess("优化成功");
        this.batchOptimizeBtnStatus.icon = '';
        this.batchOptimizeBtnStatus.display = false;
        this.getList();
      }).catch(()=>{
        this.batchOptimizeBtnStatus.icon = '';
        this.batchOptimizeBtnStatus.display = false;
      })
    },

    // 批量生成
    handleBatchAiCreateTestCase(){

        this.batchCreateCaseRecord = 0;
        this.batchCreateBtnStatus.display = true;
        this.batchCreateBtnStatus.icon = 'el-icon-loading';
        aiCreateBatchCase(this.queryParams).then(res => {
          this.$modal.msgSuccess(res.msg);
          this.getBatchTaskRecordInfo();
        }).catch(()=>{
          //this.batchCreateBtnStatus.display = true;
          //this.batchCreateBtnStatus.icon = 'el-icon-video-play';
          this.getBatchTaskRecordInfo();
        });
    },

    // 单个生成
    handleSignalAiCreateTestCase(row){
      let title = "";
      if(row.status != 0){
        title = "是否要重新生成该功能点的测试用例?";
      }else{
        title = "是否要生成该功能点的测试用例?";
      }

      this.$modal.confirm(title).then(function() {
        row.isDisabled = true;
        row.icon = 'el-icon-loading';
        return aiCreateSignalCase({ids: [row.projectFunPointNo]});
      }).then(res => {
          this.$modal.msgSuccess(res.msg);
          this.getList();
          row.isDisabled = false;
          row.icon = 'el-icon-video-play';
        }).catch(() => {
          row.isDisabled = false;
          row.icon = 'el-icon-video-play';
          this.getList();
        });


    },

    getBatchTaskRecordInfo(){
      this.set_inter_val = setInterval(() => {
          getBatchTaskRecord().then(response => {
                this.batchCreateCaseRecord = parseFloat(((response.data.errorNum + response.data.successNum) * 100 / response.data.totalNum).toFixed(2));
                if(this.batchCreateCaseRecord >= 100){
                  clearInterval(this.set_inter_val);
                  this.set_inter_val = null;
                  this.batchCreateBtnStatus.display = false;
                  this.batchCreateBtnStatus.icon = 'el-icon-video-play';
                  if(!this.is_first_into){
                    this.$modal.alertWarning("用例生成完成");
                    this.getList();
                  }

                }
          });
      }, 500)
    },
    format(percentage) {
      percentage = parseFloat(percentage.toFixed(2));
      return percentage >= 100 ? '完成' : `${percentage}%`;
    },
    showTestCase(row){
      const query = {
        projectFunNo: row.projectFunNo,
        projectFunPointNo: row.projectFunPointNo,
        projectNo: row.projectNo
      };
      const path = "/ai_smart/case";
      this.$router.push({ path: path, query: query });
    },
    /**
    查询条件的项目列表
    */
    getProjectListInfo(){
      getProjectList().then(res => {
          this.projectList = res.data;
        }).catch(()=>{
          this.projectList = [];
        });
    },
    getFunList(){
      if(!this.queryParams.projectNo){
        this.funList = [];
        return ;
      }
      listFun(this.queryParams.projectNo).then(response => {
        this.funList = response.data;
      });
    },

    //自动生成用例
    ai_create_case(){
      this.createAiCaseDemoIcon = "el-icon-loading";
      this.createAiCaseDemoDisable = true;
      aiCreateCase(this.form).then(res=>{
        this.addCaseForm.form= res.data
        this.createAiCaseDemoIcon = "el-icon-video-play";
        this.createAiCaseDemoDisable = false;
      }).catch(res=>{
        this.createAiCaseDemoIcon = "el-icon-video-play";
        this.createAiCaseDemoDisable = false;
      })
    },
    // 跳转评审页面
    goCheck(pointNo){
      const path = "/ai_smart/checkCase";
      const tempQuery = {
          projectNo: this.queryParams.projectNo,
          projectFunNo: this.queryParams.projectFunNo,
          projectFunPointNo: pointNo,
          projectFunPointType: this.queryParams.projectFunPointType,
          projectFunPointPath: this.queryParams.projectFunPointPath,
          finalStatus: this.queryParams.finalStatus,
          caseFinalStatus: this.queryParams.caseFinalStatus,
          createDate: this.queryParams.createDate,
          startDate: this.queryParams.startDate,
          endDate: this.queryParams.endDate,
          isDeleted: this.queryParams.isDeleted
      };
      if(this.queryParams.fromFunDetail == 1){
        tempQuery.fromFunDetail = 1;
        tempQuery.type = this.queryParams.type;
        tempQuery.typeId = this.queryParams.typeId;
      }else{
        tempQuery.fromFunDetail = 0;
      }
      // const query = {"projectFunPointNo": pointNo};
      this.$router.push({ path: path, query: tempQuery});
    },
    getFunInfoDetailBack(node){
        get_fun_info_detail(node.id).then(res =>{
          this.editPointFunInfo = res.data;
          console.log(this.editPointFunInfo);
      });
    },

    getFunInfoDetail(){
      if(!this.form.projectFunNo){
        return ;
      }
      get_fun_info_detail(this.form.projectFunNo).then(res =>{
          this.editPointFunInfo = res.data;
          this.inputList= [];
          this.outList= [];
          this.ruleList= [];
          if(!this.form.projectFunNo){
            return ;
          }


          const pointType = this.form.projectFunPointType;
          const funNo = this.form.projectFunNo;
          if(funNo){
              for(let i = 0; i<this.editPointFunInfo[funNo].length; i++){
                if(this.editPointFunInfo[funNo][i].pageNo == this.form.pageNo){
                  if(pointType == "PAGE_INPUT"){
                    this.inputList = this.editPointFunInfo[funNo][i].inputList;
                  }else if(pointType == "PAGE_OUTPUT"){
                    this.outList = this.editPointFunInfo[funNo][i].outList;
                  }else if(pointType == "FUN"){
                    this.ruleList = this.editPointFunInfo[funNo][i].ruleList;
                  }
                }
              }

          }
      });
    },
    changePage(){
      this.inputList= [];
      this.outList= [];
      this.ruleList= [];
      this.form.typeId = null;
      if(!this.form.projectFunNo){
        return ;
      }


      const pointType = this.form.projectFunPointType;
      const funNo = this.form.projectFunNo;
      if(Object.keys(this.editPointFunInfo).length === 0){
        this.getFunInfoDetail();
      }
      if(funNo){
          for(let i = 0; i<this.editPointFunInfo[funNo].length; i++){
            if(this.editPointFunInfo[funNo][i].pageNo == this.form.pageNo){
              if(pointType == "PAGE_INPUT"){
                 this.inputList = this.editPointFunInfo[funNo][i].inputList;
              }else if(pointType == "PAGE_OUTPUT"){
                this.outList = this.editPointFunInfo[funNo][i].outList;
              }else if(pointType == "FUN"){
                this.ruleList = this.editPointFunInfo[funNo][i].ruleList;
              }
            }
          }

      }
    },
    relationDoc(){
      this.relationObj.open = true;
      const id = this.relationObj.tempPointNo;
      getPoint(id).then(response => {
        this.form = response.data;
        this.check_change(this.form.projectNo);
        this.getFunInfoDetail();
      });
    }
  }
};
</script>
<style>

.check-right{
      height: calc(100vh - 180px) !important;
      width: 100%;
      overflow: auto;
}

.demo-table-expand {
    font-size: 0;
  }
  .demo-table-expand label {
    width: 90px;
    color: #99a9bf;
  }
  .demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 50%;
  }
</style>
